//
//  GKDPageViewController.m
//  GKDPageViewController
//
//  Created by gkoudai on 2017/8/3.
//  Copyright © 2017年 gkoudai. All rights reserved.
//

#import "GKDPageViewController.h"
#import <Masonry/Masonry.h>

@interface GKDPageViewController ()

@end

@implementation GKDPageViewController

- (void)viewDidLoad {
    [super viewDidLoad];
    
    // 不加这个 View 会触发系统自动下偏移
    UIView *mainView = [UIView new];
//    mainView.frame = self.view.bounds;
    [self.view addSubview:mainView];
    [mainView mas_makeConstraints:^(MASConstraintMaker *make) {
        make.edges.mas_equalTo(UIEdgeInsetsZero);
    }];
}

- (void)viewWillAppear:(BOOL)animated {
    [super viewWillAppear:animated];
    if (self.pageViewWillAppear) {
        self.pageViewWillAppear(animated);
    }
}

- (void)viewDidAppear:(BOOL)animated {
    [super viewDidAppear:animated];
    if (self.pageViewDidAppear) {
        self.pageViewDidAppear(animated);
    }
}

- (void)viewWillDisappear:(BOOL)animated {
    [super viewWillDisappear:animated];
    if (self.pageViewWillDisappear) {
        self.pageViewWillDisappear(animated);
    }
}

- (void)viewDidDisappear:(BOOL)animated {
    [super viewDidDisappear:animated];
    if (self.pageViewDidDisappear) {
        self.pageViewDidDisappear(animated);
    }
}

- (BOOL)shouldAutomaticallyForwardAppearanceMethods {
    return NO;
}

@end
